/*
* created by Administrator on 2018/12/3
* 好的代码像粥一样,是得用时间和精力熬的。
*/
// import foo from './a';
// //import {a as _a} from './a';  //导入
// import {b} from './b';  //导入
// import {c} from './c';  //导入
// let a = 1000;
// console.log(foo.a +b+c+a);

//原型模拟类的实现
//用对象的原型属性__proto__模拟类【class】的实现
// function Person (name,age,gender){  //构造函数  (构造器)
//     this.name = name;
//     this.age = age;
//     this.gender = gender;
// }
// Person.prototype = {
//     constructor:Person,   //还原构造器
//     eat: function(){
//         console.log('I am eating now!');
//     },
// };
// let a= new Person('a',18,'false');
// aa.eat();


//类
class Person{
    constructor(name,age,gender) {  //私有
        this.name = name;
        this.age = age;
        this.gender = gender;
    };
    eat(){  //共同
        console.log('I am eating now!');
    };
};
 let aa = new Person('aa',19,true);
 aa.eat();
